package com.mobialia.socialmediademo;

import android.database.Cursor;

/**
 *  A facebook or twitter update
 */

public class Update {

	long id;
	String userId;
	String userName;
	String message;
	long timeStamp;
	String imageUrl;
	
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public long getTimeStamp() {
		return timeStamp;
	}
	public void setTimeStamp(long timeStamp) {
		this.timeStamp = timeStamp;
	}
	
	public String getImageUrl() {
		return imageUrl;
	}
	public void setImageUrl(String imageUrl) {
		this.imageUrl = imageUrl;
	}

	@Override
	public String toString() {
		return "Update [userId=" + userId + ", userName=" + userName
				+ ", text=" + message + ", timeStamp=" + timeStamp + "]";
	}

	public void fromCursor(Cursor cur) {
		setId(cur.getInt(cur.getColumnIndex("id")));
	    setUserId(cur.getString(cur.getColumnIndex("userId")));
	    setUserName(cur.getString(cur.getColumnIndex("userName")));
	    setMessage(cur.getString(cur.getColumnIndex("message")));
	    setTimeStamp(cur.getLong(cur.getColumnIndex("timeStamp")));
	    setImageUrl(cur.getString(cur.getColumnIndex("imageUrl")));
	}
	
}
